package cn.com.smartdevices.bracelet.chart.data;

import android.util.SparseArray;

/* renamed from: cn.com.smartdevices.bracelet.chart.b.d */
public class ChartDataLoader { // C0746d
    protected LoadCallback f3944a;
    protected SparseArray<ItemData> f3945b;
    protected boolean f3946c;

    public interface LoadCallback { // C0731f
        void onDataLoaded(ItemData c0737e);  // m8473a

        boolean hasData(int i); // m8474a

        ItemData loadData(int i); //m8475b

        void onToItem(int i);  //m8476c
    }

    public ChartDataLoader() {
        this.f3945b = new SparseArray();
    }



    public void loadItemData (int i) { //m8607a
        this.f3946c = false;
        ItemData b = this.f3944a.loadData(i);
        b.f3897g = i;
        this.f3945b.put(i, b);
        if (!this.f3946c) {
            this.f3944a.onDataLoaded(b);
        }
    }

    public void putItemData (int i, ItemData c0737e) { //m8608a
        this.f3945b.put(i, c0737e);
    }

    public void setLoadCallback (LoadCallback c0731f) { // m8609a
        this.f3944a = c0731f;
    } //m8609a

    public boolean isCancelled () { // m8610a
        return this.f3946c;
    }

    public ItemData getItemData (int i) { // m8611b
        return (ItemData) this.f3945b.get(i);
    }

    public void cancel () { // m8612b
        this.f3946c = true;
    }

    public void clearData () { // m8613c
        this.f3945b.clear();
    }

    public boolean hasItemData (int i) { //m8614c
        return this.f3944a.hasData(i);
    }

    public LoadCallback getLoadCallback () { // m8615d
        return this.f3944a;
    }

    public void onToItem (int i) { //m8616d
        this.f3944a.onToItem(i);
    }
}
